<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改设备')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-device-edit" th:object="${bizDevice}">
            <input name="id" th:field="*{id}" type="hidden">
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">设备类型：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select name="deviceType" class="form-control m-b" th:with="type=${@dict.getType('deviceType')}">-->
<!--                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{deviceType}"></option>-->
<!--                    </select>-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">设备名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">设备号：</label>
                <div class="col-sm-8">
                    <input name="deviceCode" th:field="*{deviceCode}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">设备二维码：</label>
                <div class="col-sm-8">
                    <input name="qrCode" th:field="*{qrCode}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">设备场地：</label>
                <div class="col-sm-8">
<!--                    <select name="position" class="form-control m-b" th:with="type=${@dwl.getType('biz_site')}">-->
<!--                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{position}"></option>-->
<!--                    </select>-->
                    <input name="position" th:field="*{position}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">折扣：</label>
                <div class="col-sm-8">
                    <input name="discount" th:field="*{discount}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">客服电话：</label>
                <div class="col-sm-8">
                    <input name="customerServicePhone" th:field="*{customerServicePhone}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最大端口数：</label>
                <div class="col-sm-8">
                    <input name="maxCargoLane" th:field="*{maxCargoLane}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">到期时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="dueDtime" th:value="${#dates.format(bizDevice.dueDtime, 'yyyy-mm-dd HH:mm:ss')}" class="form-control" placeholder="yyyy-mm-dd HH:mm:ss" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">续费状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('renewStatus')}">
                        <input type="radio" th:id="${'renewStatus_' + dict.dictCode}" name="renewStatus" th:value="${dict.dictValue}" th:field="*{renewStatus}">
                        <label th:for="${'renewStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">启用状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('enableStatus')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "biz/device";
        $("#form-device-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-device-edit').serialize());
            }
        }

        $("input[name='lastReplenishmentTime']").datetimepicker({
            format: "yyyy-mm-dd HH:mm:ss",
            minView: "1",
            autoclose: true
            // format: "yyyy-mm-dd",
            // minView: "month",
            // autoclose: true
        });

        $("input[name='lastUpdateTime']").datetimepicker({
            format: "yyyy-mm-dd HH:mm:ss",
            minView: "1",
            autoclose: true
            // format: "yyyy-mm-dd",
            // minView: "month",
            // autoclose: true
        });

        $("input[name='dueDtime']").datetimepicker({
            format: "yyyy-mm-dd HH:mm:ss",
            minView: "1",
            autoclose: true
            // format: "yyyy-mm-dd",
            // minView: "month",
            // autoclose: true
        });
    </script>
</body>
</html>